package cn.tedu.tea.assemble;

import cn.tedu.tea.domain.bo.ContentBO;
import cn.tedu.tea.domain.vo.ContentVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
* @author Hyanze
* @description 内容表
* @date 2023/4/20 2023/4/20
*/
@Data
public class ContentAssemble {

    public static ContentVO ContentBO2VO(ContentBO contentBO){
        System.out.println("contentBO="+contentBO);
        ContentVO contentVO = new ContentVO();
        BeanUtils.copyProperties(contentBO,contentVO);
        System.out.println("contentVO="+contentVO);
        return contentVO;
    }

    public static List<ContentVO> ContentListBO2VO(List<ContentBO> contentBOS){
        System.out.println("contentBOS="+contentBOS);
        List<ContentVO> contentVOS = new ArrayList<>();
        for (ContentBO contentBO : contentBOS){
            ContentVO contentVO = new ContentVO();
            BeanUtils.copyProperties(contentBO,contentVO);
            contentVOS.add(contentVO);
        }
        System.out.println("contentVOS="+contentVOS);
        return contentVOS;
    }

}
